/*
 * @Author: your name
 * @Date: 2022-01-06 09:45:04
 * @LastEditTime: 2022-01-08 20:04:15
 * @LastEditors: Please set LastEditors
 * @Description: 配置
 * @FilePath: \homepage\src\main.js
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入库
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import useComponents from './components/index.js'
// 注册
Vue.use(ElementUI);
Vue.use(useComponents);





Vue.config.productionTip = false

//自定义属性  用于解决照片报错问题
Vue.directive('fiximg', {
    inserted(el, options) {
        el.addEventListener('error', () => {
            el.src = options.value
        })

        el.src = el.src || options.value
    },

    componentUpdated(el, options) {
        el.src = el.src || options.value
    }
})




new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})